package com.ansion.basedb.dao.helper;

import androidx.annotation.NonNull;

import com.ansion.basedb.dao.model.GroupModel;
import com.ansion.basedb.database.sql.SQLRow;
import com.ansion.basedb.database.sql.SqlEntityWrapper;

import java.util.List;


public class GroupQueryBeanForUI extends SqlEntityWrapper {

    private String gid;
    private String groupMembers;
    private long lastRequestTime;

    public GroupQueryBeanForUI() {
    }


    @Override
    public void readFromSQLRow(@NonNull SQLRow row) {
        gid = row.getAsString(GroupModel.kColumnName_Group_Id);
        groupMembers = row.getAsString(GroupModel.kColumnName_Members);
        lastRequestTime = row.getAsLong(GroupModel.kColumnName_lastRequestTime);
    }

    public String getGid() {
        return gid;
    }

    public List<String> getGroupMembers() {
        return GroupModel.getGroupMemberUidList(groupMembers);
    }

    public long getLastRequestTime() {
        return lastRequestTime;
    }
}
